<?php

namespace app\api\controller;

use think\facade\Cache;

class Limit extends ApiBase {

    /**
     * 服务限流 php + redis
     */
    public function index() {
        $key = 'mall_limit_' . time();
        $count = Cache::inc($key);
        if ($count > 500) {
            return false;
        }
        return true;
    }
}